#!/bin/sh

dest="Package/dest"
comp="Package/Package_contents/Components"
pref="Package/Package_contents/PreferencePanes"

xcodebuild -target HelperApplet clean
xcodebuild -target PrefPane clean
xcodebuild -target CocoaWinController clean
xcodebuild -target MacUIM clean

xcodebuild -buildstyle Deployment -target PrefPane || exit 1
xcodebuild -buildstyle Deployment -target MacUIM || exit 1

rm -rf ${pref}
mkdir -p ${pref}

mv -v build/Deployment/MacUIM.prefPane ${pref}

rm -rf ${comp}
mkdir -p ${comp}

mv -v build/Deployment/MacUIM.component ${comp}
